package useragent

// 预定义的UserAgent模式
var userAgentPatterns = []userAgentPattern{
	// Windows Chrome
	{"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36", Windows, Desktop, Chrome},
	{"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36", Windows, Desktop, Chrome},
	// Windows Firefox
	{"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:%s) Gecko/20100101 Firefox/%s", Windows, Desktop, Firefox},
	// Windows Edge
	{"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 Edg/%s", Windows, Desktop, Edge},

	// MacOS Chrome
	{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36", MacOS, Desktop, Chrome},
	// MacOS Safari
	{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/%s Safari/605.1.15", MacOS, Desktop, Safari},
	// MacOS Firefox
	{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:%s) Gecko/20100101 Firefox/%s", MacOS, Desktop, Firefox},

	// Linux Chrome
	{"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36", Linux, Desktop, Chrome},
	// Linux Firefox
	{"Mozilla/5.0 (X11; Linux x86_64; rv:%s) Gecko/20100101 Firefox/%s", Linux, Desktop, Firefox},

	// Android Chrome
	{"Mozilla/5.0 (Linux; Android 10; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36", Android, Mobile, Chrome},
	{"Mozilla/5.0 (Linux; Android 11; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36", Android, Mobile, Chrome},
	// Android Firefox
	{"Mozilla/5.0 (Android 11; Mobile; rv:%s) Gecko/%s Firefox/%s", Android, Mobile, Firefox},

	// iOS Safari
	{"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/%s Mobile/15E148 Safari/604.1", IOS, Mobile, Safari},
	{"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/%s Mobile/15E148 Safari/604.1", IOS, Mobile, Safari},

	// iPad Safari
	{"Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/%s Mobile/15E148 Safari/604.1", IOS, Tablet, Safari},
}

// 浏览器版本范围
var browserVersions = map[Browser][]string{
	Chrome:  {"98.0.4758.102", "99.0.4844.51", "100.0.4896.60", "101.0.4951.41", "102.0.5005.61"},
	Firefox: {"97.0", "98.0", "99.0", "100.0", "101.0"},
	Safari:  {"15.0", "15.1", "15.2", "15.3", "15.4"},
	Edge:    {"98.0.1108.50", "99.0.1150.30", "100.0.1185.36", "101.0.1210.32", "102.0.1245.30"},
}
